package com.snowflake.ecatalog.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.snowflake.ecatalog.entity.Goods;

/**
 * 商品
 */
public interface GoodsDao extends PagingAndSortingRepository<Goods, Long>, JpaSpecificationExecutor<Goods> {
	@Modifying
	@Query("update Goods g set g.status = ?1 where g.id=?2")
	void changeStatus(Integer status, Long id);

	List<Goods> findByCategoryProfileIdAndStatus(Long profileId, int status);
}
